<template>
  <div>
    <treeselect
      :multiple="true"
      :options="options"
      placeholder="请选择查询"
      v-model="value"
    />
    <pre class="result">{{ value }}</pre>
  </div>
</template>

<script>
// import the component
import Treeselect from '@riophae/vue-treeselect'
// import the styles
import '@riophae/vue-treeselect/dist/vue-treeselect.css'

export default {
  // register the component
  components: { Treeselect },
  data () {
    return {
      // define default value
      value: ['a'],
      // define options
      options: [{
        id: 'a',
        label: 'a1',
        children: [{
          id: 'aa',
          label: 'aa',
        }, {
          id: 'ab',
          label: 'ab',
        }],
      }, {
        id: 'b',
        label: 'b',
      }, {
        id: 'c',
        label: 'c',
      }],
    }
  },
}
</script>